package com.example.mybatisdemo.service.impl;

import com.example.mybatisdemo.enitity.User;
import com.example.mybatisdemo.mapper.UserMapper;
import com.example.mybatisdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName UserServiceimpl
 * @Author 刘泽
 * @Mail liuze713@hotmail.com
 * @Date 2021/12/22 5:31 PM
 * @Version 1.0
 */
@Service("userService")
public class UserServiceimpl implements UserService {
  @Autowired
  private UserMapper userMapper;

  @Override
  @Transactional(rollbackFor = Exception.class)
  public List<User> findAll() {
    return userMapper.findAll();
  }
}
